/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.klikmee.sms.core.base.dao;

import java.util.List;

import javax.persistence.NoResultException;

import com.klikmee.sms.core.model.Client;

/**
 * 
 * @author makcro
 */
public class ClientDAO extends AbstractDAO<Client> {

	public ClientDAO() {
		super( Client.class );
	}

	public List<Client> findRange( int[] range ) {
		throw new UnsupportedOperationException( "Not supported yet." );
	}

	public int count() {
		throw new UnsupportedOperationException( "Not supported yet." );
	}

	public Client findByUsername( String username ) {
		Client singleResult = null;
		try {
			singleResult = (Client) this.entityManager.createNamedQuery( "Client.findByUsername" ).setParameter( "username", username ).getSingleResult();
			return singleResult;
		} catch (NoResultException e) {
			return null;
		}

	}

}
